import QtQuick 2.6
import QtQuick.Window 2.2
import QtQml.Models 2.2
Window {
    visible: true
    width: 640
    height: 480
    title: qsTr("Hello World")

    ListModel {
        id:m_model
          ListElement {
              name: "Bill Smith"
              number: "555 3264"
              color1:"red"
          }
          ListElement {
              name: "John Brown"
              number: "555 8426"
              color1:"green"
          }
          ListElement {
              name: "Sam Wise"
              number: "555 0473"
               color1:"blue"
          }
      }
    ObjectModel {
        id: itemModel
        Rectangle { height: 20; width: 80;
        Text{
            color: "red"
           text:"Bill Smith"+":"+"555 3264"
        }

        }
        Rectangle { height: 20; width: 80;
            Text{
                 color: "green"
               text: "John Brown"+":"+"555 8426"
            }
        }
        Rectangle { height: 20; width: 80;
            Text{
                color: "blue"
               text:"Sam Wise"+":"+"555 0473"
            }
        }
    }
    Column{
        spacing: 10
    ListView
    {
        width: 100
        height: 100
        model:m_model
        delegate: Text{
        color: color1
        text:name+":"+number}
    }

    ListView{
    width: 100
    height: 100
    model:myObjectModel
    delegate: Text{
    color: model.modelData.color
    text:name+":"+number}
    }
    ListView{
    width: 100
    height: 100
    model:name1
    delegate: Text{
    text:modelData}
    }

    ListView{
        width: 100
        height: 100
        model:itemModel
    }

    ListView{
        width: 100
        height: 100
        model:myModel
        delegate: Text{
        color: color1
        text:name+":"+number}
    }
}

}
